package com.certificationManager.client.util;

import java.util.Date;

/**
 * @author Benjamin Barbier
 *
 */
public class CookieUtils {

	private static final CookieUtils singleton = new CookieUtils();
	
	public static final String LANGUAGE_COOKIE = "language";
	public static final String USERID_COOKIE = "userId";
	
	private CookieUtils() {}
	
	public static CookieUtils getInstance() {return singleton;}
	
	/**
	 * @return the cookie duration.
	 */
	public Date getDuration() {
		Date now = new Date();
		long nowLong = now.getTime();
		nowLong = nowLong + (1000 * 60 * 60 * 24 * 365); // 1 Year
		now.setTime(nowLong);
		return now;
	}
	
}
